package com.luoqiu.springCloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author 洛秋y
 * @date 2020/11/11 9:41
 */
@Configuration
public class OrderConfig {

    @Bean
    //@LoadBalanced //让RestTemplate使用负载均衡  在服务是集群的情况下 不加这个注解 调用服务会失败
    public RestTemplate getRestTemplate() {

        return new RestTemplate();
    }
}
